package com.web;

import com.pojo.DaYi_x;
import com.service.DaYiService_x;
import com.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.List;

@RestController
@RequestMapping("/dayi")
public class DayiController_x {
    @Autowired
    private DaYiService_x daYiServiceX;
    @RequestMapping("/select")
    public List<DaYi_x> selectAll() {
        return daYiServiceX.selectAll();
    }
    @RequestMapping("select2")
    public List<DaYi_x> selectAll1(){
        return daYiServiceX.selectAll1();
    }
    @RequestMapping("select1")
    public DaYi_x listAll(Integer id){
        return daYiServiceX.listAll(id);
    }
    @RequestMapping("select3")
    public List<DaYi_x> selectAll2(){
        return daYiServiceX.selectAll2();
    }
    @RequestMapping("select4")
    Result selectAll3(){
        return Result.ok(daYiServiceX.selectAll3());
    }
    @RequestMapping("show")
    public Result select1(Integer id, String user,String time1,String time2){
        return Result.ok(daYiServiceX.select1(id,user,time1,time2));
    }
    @RequestMapping("add")
    Result add(DaYi_x daYiX){
        System.out.println("======");
        return Result.ok(daYiServiceX.add(daYiX));
    }

    @RequestMapping("delete")
    Result delete(Integer id){
        return Result.ok(daYiServiceX.delete(id));
    }
}
